package Utils;
public class XmlReplace {
    public static String escape( String text ) {
    	if(text==null) return "";
    	String t=text;
    	t=t.replace("&", "&amp;");
   // 	t=t.replace("&", "&amp;");
    	t=t.replace("<", "&lt;");
    	t=t.replace(">", "&gt;");
    	//t=t.replace("\'", "&apos;");
    	t=t.replace("\"", "&quot;");
    	
    	
    	return t;
    }
    public static String unescape( String text ) {
    	if(text==null) return "";
    	String t=text;
    	t=t.replace("&amp;","&");
    	t=t.replace("&lt;","<");
    	t=t.replace("&gt;",">");
    	t=t.replace("&quot;","\"");
    	
    	
    	return t;
    }
  
}
